package com.gears_software.sxdc.dccx.data.finder;

import com.gears_software.sxdc.dccx.data.finder.util.GearsAuthInterceptor;
import com.gears_software.sxdc.dccx.data.model.CanUseVouchersModel;
import com.gears_software.sxdc.dccx.data.model.ResultModel;
import com.gears_software.sxdc.dccx.data.model.VouchersModel;
import com.gears_software.sxdc.dccx.data.model.request.RRedeemcodeModel;

import org.androidannotations.rest.spring.annotations.Body;
import org.androidannotations.rest.spring.annotations.Get;
import org.androidannotations.rest.spring.annotations.Path;
import org.androidannotations.rest.spring.annotations.Post;
import org.androidannotations.rest.spring.annotations.Rest;
import org.androidannotations.rest.spring.api.RestClientErrorHandling;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by chezhenzhen on 2017/11/22.
 */

@Rest(rootUrl = RequestUrl.ROOT, converters = {MappingJackson2HttpMessageConverter.class}, interceptors = GearsAuthInterceptor.class)
public interface IVouchersFinder extends RestClientErrorHandling {

    //获取优惠劵接口
    @Get("/api/voucher/get_uservoucherlist?statusid={statusid}")
    ResultModel<List<VouchersModel>> getVouchersList(@Path String statusid);

    //兑换码兑换优惠劵
    @Post("/api/voucher/exchange_voucher")
    ResultModel<String> exChangeVoucher(@Body RRedeemcodeModel redeemcodeModel);

    //支付时可用的优惠劵接口
    @Get("/api/voucher/get_canusevoucer?factprice={factprice}")
    ResultModel<List<CanUseVouchersModel>> getCanUse(@Path BigDecimal factprice);

}
